Spread ASP.NET 6.0 Product Documentation
SortRows(Int32,Int32,SortInfo[]) Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetView Class > SortRows Method : SortRows(Int32,Int32,SortInfo[]) Method


row
Starting row index (the start of the range of rows to sort)
rowCount
Number of rows in the range to sort
sortInfo
Array of SortInfo objects containing the column indexes and the order of sorting

Glossary Item Box

Sorts a range of rows in the sheet according to the specified parameters.

Syntax

Visual Basic (Declaration) 
Public Overloads Function SortRows( _
   ByVal row As Integer, _
   ByVal rowCount As Integer, _
   ByVal sortInfo() As SortInfo _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim row As Integer
Dim rowCount As Integer
Dim sortInfo() As SortInfo
Dim value As Boolean
 
value = instance.SortRows(row, rowCount, sortInfo)
C# 
public bool SortRows( 
   int row,
   int rowCount,
   SortInfo[] sortInfo
)

Parameters

row
Starting row index (the start of the range of rows to sort)
rowCount
Number of rows in the range to sort
sortInfo
Array of SortInfo objects containing the column indexes and the order of sorting

Return Value

true if successful; otherwise false

Remarks

Use this method if you want to sort only a range of rows and not the entire sheet.

Use this method if you want to specify more than one column by which to sort, in other words, if you have more than one key for sorting. The SortInfo array can contain multiple keys (multiple columns) and the first specified column is the primary key, etc. The SortInfo array can also contain a value for IComparer to allow you to specify the way of comparing that is used in the sort and it may be different for each key.

Example

This example illustrates the use of this member by sorting the rows with the specified parameters.
C#Copy Code
FarPoint.Web.Spread.SheetView sv;
FarPoint.Web.Spread.SortInfo[] s = new FarPoint.Web.Spread.SortInfo[1];
s[0] = new FarPoint.Web.Spread.SortInfo(0, false);
sv = FpSpread1.ActiveSheetView;
sv.SortRows(0, 2, s);
Visual BasicCopy Code
Dim sv As FarPoint.Web.Spread.SheetView
Dim s(1) As FarPoint.Web.Spread.SortInfo
s(0) = New FarPoint.Web.Spread.SortInfo(0, False)
sv = FpSpread1.ActiveSheetView
sv.SortRows(0, 2, s)

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.